class Buzzer:

    def __init__(self, framework):
        self.framework = framework
        self.command = {}

    def tone(self, tone):
        self.command = {"type": "buzzer-tone", "tone": tone}
        if self.framework.status:
            self.framework.write(self.command)

    def stop(self):
        self.command = {"type": "buzzer-stop"}
        if self.framework.status:
            self.framework.write(self.command)
